# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-dill
_pyname=dill
pkgver=0.3.9
pkgrel=0
pkgdesc="Python serializer supporting a broader range of types than pickle"
url="https://pypi.org/project/dill/"
arch="noarch"
license="BSD-3-Clause"
makedepends="python3 py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://github.com/uqfoundation/dill/releases/download/$pkgver/dill-$pkgver.tar.gz"
builddir=$srcdir/$_pyname-$pkgver

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	export PYTHONPATH=build/lib
	for t in dill/tests/test*.py; do
		echo "$t"
		.testenv/bin/python3 "$t"
	done
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	rm -rf "$pkgdir"/usr/lib/python3*/site-packages/dill/tests
}

sha512sums="
461943ff8a0b7212b30e7c8b9e35348d0215c1c6dca356ad813e15c8721f39692fb61809349e5ee63a00d19a39aeae34c3b4def17257f8f7820e4318b81b273f  dill-0.3.9.tar.gz
"
